<template>

      <el-container>

        <el-aside width="200px">
          <MinisterMenu></MinisterMenu>
        </el-aside>

        <el-main style="padding:0px">
          <el-row>
            <el-col :span="8"><h2>单独分配任务</h2></el-col>
          </el-row>
          <el-row>
            <el-button type="success" @click="showDialog">分配</el-button>
          </el-row>
           <AssignTask :dialogFormVisible="dialogFormVisible" :currentProject="this.currentProject" :information="this.information" :nowHandleProjectId="this.nowHandleProjectId" :memberList="memberList"></AssignTask>
        </el-main>

      </el-container>

</template>

<script>
/*   单独分配任务*/
import MinisterMenu from '@/components/menu/MinisterMenu.vue'
import instanceToken from "@/utlis/tokenIdentify";
import AssignTask from "@/components/minister/AssignTask.vue";
export default {
    name:'MinisterAssignTaskView',
    components: {
      AssignTask,
      MinisterMenu,
    },
    data() {
        return {
           dialogFormVisible:true,
           memberList:'',
           currentProject:'',
           information:'',
           nowHandleProjectId:'',
           dialogFormVisible:true,
            rules: {
          name: [
            { required: true, message: '请输入任务名字', trigger: 'blur' },
            { min: 3, max: 5, message: '长度在 3 到 5 个字符', trigger: 'blur' }
          ],
          details: [
            { required: true, message: '请输入任务细节', trigger: 'blur' }
          ],
          companyUserId: [
            {  required: true, message: '选择接收人', trigger: 'change' }
          ],
          startTime: [
            { type: 'date', required: true, message: '请选择开始时间', trigger: 'change' }
          ],
          estTime: [
            { type: 'date', required: true, message: '请选择结束时间', trigger: 'change' }
          ],

        },
         task: {
          name: '',
          details: '',
          companyId:'',
          projectId:'',
          departmentId:'',
          pubId:'',
          companyUserId:'',
          subTime:'',
          startTime:'',
          estTime:'',
        },

        };
    },
    methods: {
     info(){
      this.information = JSON.parse(window.sessionStorage.getItem("companyUser"));
      console.log("info")
      console.log(this.information)
    },
    getMemberlist(){
      instanceToken.get("project/minister/getMembers").then(res=>{
        this.memberList= res.data.data;
        console.log(this.memberList);
      })
    },
    showDialog(){
      console.log(this.dialogFormVisible)
      this.dialogFormVisible = true;
    }
    },
    created() {
      this.info();
      this.getMemberlist();
    },
    computed: {},
    watch: {},
    }
</script>
<style  scoped>

</style>